package edu.unlv.cs.ladders.entities;

import edu.unlv.cs.ladders.entities.Team;
import java.lang.Long;
import java.util.List;

privileged aspect Team_Roo_Entity {
    
    public static long Team.countTeams() {
        return (Long) entityManager().createQuery("select count(o) from Team o").getSingleResult();
    }
    
    public static List<Team> Team.findAllTeams() {
        return entityManager().createQuery("select o from Team o").getResultList();
    }
    
    public static Team Team.findTeam(Long id) {
        if (id == null) return null;
        return entityManager().find(Team.class, id);
    }
    
    public static List<Team> Team.findTeamEntries(int firstResult, int maxResults) {
        return entityManager().createQuery("select o from Team o").setFirstResult(firstResult).setMaxResults(maxResults).getResultList();
    }
    
}
